1. Field of the Invention
The present invention relates to a motion vector detecting apparatus suitable for use in an image processing system such as an H. 261 system, an MPEG (Moving Picture Experts Group) system or the like, wherein a motion vector relative to an already-coded frame is detected for each of blocks into which a frame of image data is divided.
2. Description of the Prior Art
FIG. 33 is a block diagram showing a motion vector detecting apparatus according to a conventional example 1 described in, for example, JP-A No. 6-113290. In the drawing, reference numeral 1 indicates an already-coded frame memory which is employed in an image processing system such as an H. 261 system, an MPEG system or the like and stores therein pixel data of a frame already coded by interframe prediction coding, i.e., pixel data for prediction of a frame coded at the present time. Upon prediction of the frame coded at the present time, a motion vector relative to each of blocks into which the coded frame is divided, is detected. Namely, horizontal and vertical distances between the position of each block in the frame coded at the present time and the position of a range corresponding to each block in the already-coded frame are detected as a motion vector.
Reference numerals 101-J (where J=0, . . . , 7) respectively indicate search window row memories for respectively storing pixel data lying in a row shifted by a column component of a predetermined search vector from the position of each of blocks in a search window corresponding to a range for searching a range corresponding to each block in the coded frame. The coded frame will be divided into blocks of 8 rows and 8 columns herein. Further, the search window will be defined as a range set when the blocks are respectively shifted from side to side by 16 pixels at maximum and shifted upward and downward by 8 pixels at maximum. Incidentally, the search vector represents horizontal and vertical distances from the position of each block referred to above to a range of pixel data to be compared with pixel data in the block. Here, the search vector corresponds to any of (-16, -8) through (+16, +8).
Reference numeral 102 indicates a search window shift register unit having shift registers constructed so that registers 103-(0, J) through 103-(7, J) are series-connected to their corresponding search window row memories 101-J by the number of columns.
Reference numeral 5 indicates a coded frame memory for storing data about pixels in a frame coded at the present time. Reference numeral 6 indicates a reference register unit for allowing registers 12-(I, J) to store data about respective pixels of Ith rows and Jth columns (where I=0, . . . , 7, and J=0, . . . , 7) in any (hereinafter called "reference block") of blocks of 8 rows and 8 columns, into which the frame coded at the present time is divided. Incidentally, pixels extending from the mth row and nth column to the (m+7)th row and (n+7)th column in the frame constitute each reference block.
Reference numeral 4 indicates an evaluation unit having pixel comparators 13-(I, J) for respectively comparing the pixel data of the respective registers 12-(I, J) of the reference register unit 6 and the pixel data of the registers 103-(I, J) constituting the shift registers of the search window shift register unit 102.
Reference numeral 7 indicates a motion vector detection unit for detecting the optimum search vector as a motion vector, based on the results of comparisons by the respective pixel comparators 13-(I, J) of the evaluation unit 4. For example, the differences between the respective two pixel data are calculated by the respective pixel comparators 13-(I, J) and a search vector at the time that the sum of absolute values of their differences is minimum, is defined as a motion vector.
The operation will next be described.
First, the already-coded frame memory 1 supplies any pixel data of 8 rows of the search window to their corresponding search window row memories 101-0 through 101-7.
Thereafter, the search window row memories 101-0 through 101-7 output pixel data constituting one-row pixel data supplied thereto to their corresponding registers 103-(0, 0) through 103-(0, 7) of the search window shift register unit 102 in order for each clock.
The respective registers 103-(I, J) of the search window shift register unit 102 supply the stored pixel data to the next-stage registers 103-(I+1, J) and the pixel comparators 13-(I, J) of the evaluation unit 4 for each clock and store the pixel data supplied from the pre-stage registers 103-(I-1, J) or the search window row memories 101-J therein during one clock, respectively. Incidentally, the registers 103-(7,J) supply pixel data to the pixel comparators 13-(I, J) of the evaluation unit 4 alone. Namely, pixel data lying in a range of 8 rows and 8 columns moved in the horizontal direction by one pixel for each clock, of pixel data of jth to (j+7)th columns in the frame and lying within the search window are supplied to the evaluation unit 4.
On the other hand, the coded frame memory 5 allows the registers 12-(0, 0) through 12-(7, 7) of the reference register unit 6 to store pixel data in any of the blocks into which the coded frame is divided.
Further, the registers 12-(0, 0) through 12-(7, 7) of the reference register unit 6 supply the pixel data thereof to the pixel comparators 13-(0, 0) through 13-(7, 7) of the evaluation unit 4 for each clock, respectively.
The pixel comparators 13-(I, J) of the evaluation unit 4 calculate the differences between the pixel data from the registers 103-(I, J) of the search window shift register unit 102 and the pixel data from the registers 12-(I, J) of the reference register unit 6 and supply their differences to the motion vector detection unit 7.
The motion vector detection unit 7 stores the difference between a position vector in a frame, of a predetermined pixel of a reference block and a position vector of each pixel in the already-coded frame to be compared with the predetermined pixel therein as a search vector together with the sum of the absolute values of their pixel data, which corresponds to an evaluation value.
When, for example, the position in the frame, of a pixel at the upper-left corner of the reference block is given as (m, n) and the position in the frame, of the pixel data supplied to the search window row memory 101-0 is given as (m-16, j) through (m+16, j), the search vector changes from (-16, j-n) to (+16, j-n).
Thus, the pixel data in the range of 8 rows and 8 columns, of the pixel data whose positions in the frame are given as (m-16, j) through (m+16, j+7), which pixel data being included in the pixel data in the already-coded frame, are compared with pixel data which constitute each block given by (m, n) through (m+7, n+7). Further, the above-described processing is performed on a range of (n-8)th to (n-1)th rows, a range of (n-7)th to nth rows, . . . , a range of (n+8)th to (n+15)th rows in the already-coded frame. Thereafter, the motion vector detection unit 7 outputs a search vector at the time that the aforementioned evaluation value is minimum, to unillustrated devices or circuits or the like as a motion vector.
Incidentally, an apparatus described in JP-A No. 9-298751 and the like are known as ones related to the present invention. However, they do not disclose the feature of the invention of the present application.
Thus, the motion vector detecting apparatus according to the conventional example 1 has a problem in that since the range to be compared with the reference block is shifted in either one of the horizontal and vertical directions so as to search all the ranges in the search window in order to detect the motion vector, a long time is required till the detection of the motion vector.
The motion vector detecting apparatus according to the conventional example 1 has another problem in that since the evaluation unit needs to have the pixel comparators of the same number as the number of pixels in the reference block, it encounters difficulties in reducing a circuit scale so as to lower the cost of the motion vector detecting apparatus.
The motion vector detecting apparatus according to the conventional example 1 has a further problem in that since it is necessary to compare all the pixels in the reference block with the pixel data in the already-coded frame, it has a difficulty in detecting motion vectors relative to all the blocks with efficiency.
The motion vector detecting apparatus according to the conventional example 1 has a still further problem in that since the comparisons between the pixel data in the pixel units are executed, it is difficult to perform comparisons between the pixel data in finer units such as semi-pixel units or the like.